<?php
/**
 * @file
 * @package mileage
 * @version $Id$
**/

if (!defined('XOOPS_ROOT_PATH')) {
	exit;
}

require_once MILEAGE_TRUST_PATH . '/class/AbstractEditAction.class.php';

/**
 * Mileage_AbstractDeleteAction
**/
abstract class Mileage_AbstractDeleteAction extends Mileage_AbstractEditAction
{
	/**
	 * _isEnableCreate
	 * 
	 * @param   void
	 * 
	 * @return  bool
	**/
	protected function _isEnableCreate()
	{
		return false;
	}

	/**
	 * prepare
	 * 
	 * @param   void
	 * 
	 * @return  bool
	**/
	public function prepare()
	{
		return parent::prepare() && is_object($this->mObject);
	}

	/**
	 * _doExecute
	 * 
	 * @param   void
	 * 
	 * @return  Enum
	**/
	protected function _doExecute()
	{
		if($this->mObjectHandler->delete($this->mObject))
		{
			return MILEAGE_FRAME_VIEW_SUCCESS;
		}

		return MILEAGE_FRAME_VIEW_ERROR;
	}
}

